﻿@model PetaPoco.Page<ZhongheCms.Models.GswViewTieba>
@{
    Layout = "~/Views/Shared/_LayoutWebsite.cshtml";
    string retUrl = "/SunJob/Tieba";
    var fp = Model.CurrentPage - 1;

    var np = Model.CurrentPage + 1;   
}
@section head
{
     <link href="/assets/css/error.css" rel="stylesheet" />
     <script src="/assets/js/jquery.validate.min.js"></script>
    <script src="/assets/js/jquery.validate.unobtrusive.min.js"></script>
    
    <link href="/assets/sunjob/css/board.css" rel="stylesheet" />
    <link rel="stylesheet" href="/kindeditor/themes/default/default.css" />
      <script charset="utf-8" src="/kindeditor/kindeditor-min.js" type="text/javascript"></script>
    <script charset="utf-8" src="/kindeditor/lang/zh_CN.js" type="text/javascript"></script>
    <style type="text/css">
    #pages{
	margin:10px auto 0;
}
#pages a{
	color:#666;
}
.pages{
	line-height:28px;
	height:28px;
	border:1px solid #eee; 
	background:#fbfbfb;
}
.pages a, .pages  span.selected, .pages  b.selected{
	display:inline-block;
	height:28px; 
	padding:0 14px;
	border-right:1px solid #eee; 
	font-family:Tahoma; 
	font-weight:bold;
}
.pages a.selected,.pages a:hover{
	color:#f60;
}
.pages a.next,.pages a.up{
	padding:0 30px;
}
.pages span.selected,.pages b.selected{
	color:#f60;
}
.pages a.disabled{ 
	cursor: default; 
	color:#ccc
}
.pages a.disabled:hover{
	text-decoration:none
}


-->
</style>
    <script type="text/javascript">
        KindEditor.ready(function (K) {

            var editor2 = K.create('#txtcontent', {
                cssPath: '/kindeditor/plugins/code/prettify.css',
                uploadJson: '/kindeditor/upload_json.ashx',
                fileManagerJson: '/kindeditor/file_manager_json.ashx',
                items: [
						'fontname', 'fontsize', '|', 'forecolor', 'hilitecolor', 'bold', 'italic', 'underline',
						'removeformat', '|', 'justifyleft', 'justifycenter', 'justifyright', 'insertorderedlist',
						'insertunorderedlist', '|', 'emoticons', 'image', 'link'],


            });

        });
        $(function () {
            $("#valiCode").bind("click", function () {
                this.src = "/GsnService/GetValidateCode?time=" + (new Date()).getTime();
            });

        });
    </script>
     @* <script language="JavaScript">
          window.onload = function () {
              doubleBgColor(document.getElementById("info"), "#f9f9f9", "#ffffff");
              showtable();
          }

          function doubleBgColor(Table, Bg1, Bg2) {
              for (var i = 0; i < Table.rows.length; i++) {
                  Table.rows[i].bgColor = i % 2 ? Bg2 : Bg1;
              }
          }
          function showtable() {
              var tableid = 'info';   //表格的id
              var overcolor = '#FCF9D8'; //鼠标经过颜色
              var color1 = '';
              var tablename = document.getElementById(tableid)
              var tr = tablename.getElementsByTagName("tr")
              for (var i = 1 ; i < tr.length; i++) {
                  tr[i].onmouseover = function () {
                      color1 = this.style.backgroundColor
                      this.style.backgroundColor = overcolor;
                  }
                  tr[i].onmouseout = function () {
                      if (this.rowIndex % 2 == 0) {
                          this.style.backgroundColor = color1;
                      } else {
                          this.style.backgroundColor = color1;
                      }
                  }
              }
          }
            </script>*@
}
 <div class="fix gWrapper">
        <div class="breakcrumb">
            <a href="/">首页</a>&nbsp;&gt;&nbsp;
            <a href="/SunJob/Tieba">贴吧交友</a>
        </div>
        <!--广告位-->
       @* <div class="advImgBox mb15">
            <a href="" target="_blank"><img src="img/cfd041571150638dc11aeda9264d9a6d.jpg" border="0" width="1200" height="90" alt=""></a>
        </div>*@
        <div  class="wrap block">
          
           <table width="1170" border="0" cellpadding="0" cellspacing="0">
               <tr align="center" valign="middle" class="name" background="/assets/sunjob/images/tianbabg.jpg">
                   <td width="100" height="47" class="name">状态</td>
                   <td width="575" height="47" align="center" background="/assets/sunjob/images/tianbabg.jpg">主题</td>
                   <td width="100" height="47">作者</td>
                   <td width="100" height="47">回复</td>
                   <td width="100" height="47">人气</td>
                   <td width="195" height="47">发表时间</td>
               </tr>
                @foreach (var item in Model.Items)
                        {
                              <tr align="center" valign="middle" class="leftmenu" height="42">
                                <td class="first_td"><a href="/SunJob/TiebaDesc/@item.Id" target="_blank"><img src="/Assets/sunjob/img/topicnew.gif" alt="新帖"></a></td>
                                <td style="text-align:left"><a href="/SunJob/TiebaDesc/@item.Id" class="red" target="_blank">@item.Title</a></td>
                                <td>
                                    <a href="/SunJob/TiebaDesc/@item.Id" target="_blank">@item.MemberName</a>
                                </td>
                                <td>@item.ReplyNum</td>
                                <td>@item.VisitNum</td>
                                <td style="border-right:0px;">@item.PubDate.ToShortDateString()<span>&nbsp;</span>@item.PubTime</td>


                            </tr>
                    <tr align="center" valign="middle" bgcolor="#C9C9C9">
            <td height="1" colspan="6"></td>
            </tr>
                        }
         
         
        </table>
        </div>
        @if (Model.TotalPages > 1)
        {
              <div id="pages">


                

            <div class="pages">
                
                <a href="/SunJob/Tieba/0?pageIndex=1">首页</a>
                @if (Model.CurrentPage-1 > 0)
                {
                    <a href="/SunJob/Tieba/0?pageIndex=@fp">上一页</a>    
                }
                 @for (int i = 1; i <= Model.TotalPages; i++)
                 {
                     if (i == Model.CurrentPage)
                     {
                         <span class="selected">@i</span>
                     }
                     else
                     {
                          <a href="/SunJob/Tieba/0?pageIndex=@i">@i</a>
                     }
                 }
            
                @if (Model.CurrentPage + 1 <= Model.TotalPages)
                {
                     <a href="/SunJob/Tieba/0?pageIndex=@np">下一页</a>    
                }
                
               <a href="/SunJob/Tieba/0?pageIndex=@Model.TotalPages">尾页</a>
            </div>


            </div>
        }
      
    
     <div class="new_subject_form">
         <form name="newpost" method="post" action="/SunJob/TiebaPost" >
             <table width="1170" border="0" cellpadding="0" cellspacing="1" bgcolor="#FFCC97">
                 <tr>
        <td height="40" align="left" valign="middle" bgcolor="#F9E4CE" class="tianba">&nbsp;&nbsp;&nbsp;&nbsp;发布新主题</td>
      </tr>
                 <tr align="left" valign="middle" bgcolor="#FFFFFF">
                     <td width="130" height="40" align="center" class="leftmenu">标题：</td>
                     <td width="1040" height="40"><input name="txttitle" type="text" class="text" id="txttitle" style="width:450px; height:20px; padding-top:1px; " data-val="true" data-val-required="主题不允许为空">
                             <span class="field-validation-valid " data-valmsg-for="txttitle" data-valmsg-replace="true"></span></td>
                 </tr>
                 <tr align="left" valign="middle" bgcolor="#FFFFFF">
                     <td width="130"  align="center" class="leftmenu">内容：</td>
                     <td width="1040" >
                          <textarea name="txtcontent" id="txtcontent" cols="80" rows="8" data-val="true" data-val-required="内容不允许为空"></textarea>
                             <span class="field-validation-valid " data-valmsg-for="txtcontent" data-valmsg-replace="true"></span>
                     </td>
                 </tr>
                 <tr align="left" valign="middle" bgcolor="#FFFFFF">
                     <td width="130" height="40" align="center" class="leftmenu">验证码：</td>
                     <td width="1040" height="40"> <input class="ipt-text-verify"  id="verifyCodePic" name="verifyCodePic" type="text" data-val="true" data-val-required="验证码不允许为空" data-val-remote="验证码错误"  data-val-remote-url="/GsnService/CheckVerifyCode" value="" autocomplete="off">
                             <img id="valiCode" style="cursor: pointer;" src="/GsnService/GetValidateCode" alt="验证码" />
                             <span class="field-validation-valid " data-valmsg-for="verifyCodePic" data-valmsg-replace="true"></span></td>
                 </tr>
                 <tr align="left" valign="middle" bgcolor="#FFFFFF">
                     <td height="70" colspan="2" align="center" class="huiyuan2">
                          @if (Session["loginstate"] != null && Session["loginstate"].ToString() == "ok")
                             {
                                 <button type="submit" name="replysubmit" id="fastpostsubmit" class="btn_qr130" value="replysubmit" tabindex="5"><span>写好了，发布</span></button>
                             }
                             else
                             {
                                 <span> 请您先<a href="/SunJob/SignIn/0?returnUrl=@retUrl">登录</a>再发帖</span>
                             } 
                     </td>
                 </tr>
             </table>
            </form>
      
     </div>

        <!--此处为diy内容-->
    </div>
